﻿using LinPhoneWPF.BaseClass;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LinPhoneWPF
{
    public class LoginViewModel : MyBindingBase
    {
        public string ServerIP
        {
            get { return Properties.Settings.Default.ServerIP; }
            set
            {
                Properties.Settings.Default.ServerIP = value;
                OnPropertyChanged("ServerIP");
            }
        }

        public uint ServerPort
        {
            get { return Properties.Settings.Default.ServerPort; }
            set
            {
                Properties.Settings.Default.ServerPort = value;
                OnPropertyChanged("ServerPort");
            }
        }

        public string UserID
        {
            get { return Properties.Settings.Default.UserID; }
            set
            {
                Properties.Settings.Default.UserID = value;
                OnPropertyChanged("UserID");
            }
        }

        public string UserPassword
        {
            get { return Properties.Settings.Default.UserPassword; }
            set
            {
                Properties.Settings.Default.UserPassword = value;
                OnPropertyChanged("UserPassword");
            }
        }

        public MyDelegateCommand LoginCommand { get; set; }
        public MyDelegateCommand CancleCommand { get; set; }

        
        public LoginViewModel()
        {
            LoginCommand = new MyDelegateCommand(LoginCommandEx);
            CancleCommand = new MyDelegateCommand(CancleCommandEx);
        }

        private void LoginCommandEx(object par)
        {
            
        }
        private void CancleCommandEx(object par)
        {

        }
    }
}